package com.gm.osoa.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gm.osoa.action.base.SysTpEntity;
import com.gm.osoa.orm.mybatis.model.SysTpExample;

@Controller
public class SysTpAction extends SysTpEntity {
	@RequestMapping(value = "/settings/list", method = { RequestMethod.POST })
	@ResponseBody
	public Map<String, Object> list(HttpServletRequest request,
			HttpServletResponse response, @RequestParam("tp") String tp,
			@RequestParam("page") int page, @RequestParam("rows") int pageSize) {
		SysTpExample example = new SysTpExample();
		example.createCriteria().andTpTypeEqualTo(tp);
		return sysTpService.pageByExample(example, "tp_code", page, pageSize);
	}
	@RequestMapping(value = "/settings/intonew", method = { RequestMethod.GET })
	public String intonew(@RequestParam("np") String np){
		System.out.println("intonew");
		return "settings/"+np+"new";
	}
}
